/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50722
 Source Host           : localhost
 Source Database       : pidstudiodemo

 Target Server Type    : MySQL
 Target Server Version : 50722
 File Encoding         : utf-8

 Date: 06/05/2018 23:19:13 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `customer`
-- ----------------------------
DROP TABLE IF EXISTS `customer`;
CREATE TABLE `customer` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `balance` double NOT NULL DEFAULT '0' COMMENT '余额',
  `discount` double NOT NULL DEFAULT '1' COMMENT '客户折扣系数',
  `name` varchar(128) DEFAULT NULL COMMENT '客户姓名',
  `phone` varchar(128) DEFAULT NULL COMMENT '客户手机号',
  `status` varchar(128) NOT NULL DEFAULT '激活' COMMENT '客户状态',
  `user_name` varchar(128) NOT NULL COMMENT '客户账号',
  PRIMARY KEY (`id`,`user_name`),
  UNIQUE KEY `UK_qfrm64q1g4do60ini1wv5crno` (`user_name`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `customer`
-- ----------------------------
BEGIN;
INSERT INTO `customer` VALUES ('3', '2359.29', '0.5', '老胡（胡）', '15736684366', '激活', '1'), ('4', '3', '0.95', '3', '2', '激活', '15736684366'), ('5', '5', '0.95', '2', '3', '激活', '18315170177'), ('6', '0', '0', '嫖娼', '15736684366', '激活', '2');
COMMIT;

-- ----------------------------
--  Table structure for `employee_manage`
-- ----------------------------
DROP TABLE IF EXISTS `employee_manage`;
CREATE TABLE `employee_manage` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) DEFAULT NULL COMMENT '员工姓名',
  `password` varchar(128) DEFAULT NULL COMMENT '密码',
  `phone` varchar(128) DEFAULT NULL COMMENT '员工电话',
  `photo` varchar(128) DEFAULT NULL COMMENT '照片',
  `sex` varchar(128) DEFAULT NULL COMMENT '性别',
  `status` varchar(128) NOT NULL DEFAULT '在职' COMMENT '状态',
  `type_id` int(11) DEFAULT NULL,
  `number` varchar(128) NOT NULL COMMENT '员工工号',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_ovbe46yqi0l1akxq3x5yy3irq` (`number`),
  KEY `FKci6393g5i8k2lvib4yj16lsjc` (`type_id`),
  CONSTRAINT `FK_leua28nhut8k896p243pbl1to` FOREIGN KEY (`type_id`) REFERENCES `employee_type` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FKci6393g5i8k2lvib4yj16lsjc` FOREIGN KEY (`type_id`) REFERENCES `employee_type` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `employee_manage`
-- ----------------------------
BEGIN;
INSERT INTO `employee_manage` VALUES ('1', '谭永超', '1', '18315170177', '../img/login/20180528205708216.jpg', '男', '在职', '5', '0001'), ('2', '叶春林', '', '', '../img/login/20180528205828606.png', '男', '在职', '1', '0002'), ('4', '老胡', '2', '', '../util/AdminLTE/dist/img/user2-160x160.jpg', '男', '离职', '5', '0004'), ('6', '老张', '', '15736684366', '../img/login/20180528210628242.png', '男', '离职', '6', '0003'), ('8', '111', '', '15736684366', '../util/AdminLTE/dist/img/user2-160x160.jpg', '男', '离职', '3', '0005'), ('9', '1', '', '183151701771', '../util/AdminLTE/dist/img/user2-160x160.jpg', '男', '离职', '7', '0006'), ('10', '111', '', '15736684366', '../img/login/20180530155011934.jpg', '男', '离职', '6', '0007'), ('11', '嫖娼', '', '183151701771', '../util/AdminLTE/dist/img/user2-160x160.jpg', '女', '离职', '3', '0011'), ('12', '3', '', '15736684366', '../util/AdminLTE/dist/img/user2-160x160.jpg', '男', '离职', '3', '0012'), ('13', '2', null, '2', '../util/AdminLTE/dist/img/user2-160x160.jpg', '男', '离职', '3', '0014'), ('14', '2', '', '15736684366', '../img/login/20180530155051450.jpeg', '女', '离职', '3', '0024'), ('15', '111', '', '183151701771', '', '男', '离职', '3', 'q0001'), ('16', '烫发', '', '183151701771', '', '女', '离职', '4', 'q0002'), ('18', '2', '', '15736684366', '../img/login/20180530155845253.jpeg', '男', '离职', '4', '112231'), ('19', '201', null, '2021', '../util/AdminLTE/dist/img/user2-160x160.jpg', '男', '在职', '4', '00002');
COMMIT;

-- ----------------------------
--  Table structure for `employee_type`
-- ----------------------------
DROP TABLE IF EXISTS `employee_type`;
CREATE TABLE `employee_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) DEFAULT NULL COMMENT '类型名称',
  `weighting_factor` double NOT NULL DEFAULT '0' COMMENT '加权系数',
  `basic_salary` double NOT NULL DEFAULT '0' COMMENT '基本工资',
  `commission_rate` double NOT NULL DEFAULT '0' COMMENT '提成比例',
  `status` int(11) NOT NULL DEFAULT '1' COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `employee_type`
-- ----------------------------
BEGIN;
INSERT INTO `employee_type` VALUES ('1', '洗发师（员工类型已删除请尽快修改）', '1', '1500', '0.111', '0'), ('3', '高级造型师（员工类型已删除请尽快修改）', '1.21', '2500', '0.21', '0'), ('4', '专家造型师', '1.3', '3000', '0.25', '1'), ('5', '店长', '1.4', '3500', '0.3', '1'), ('6', '染发技师（员工类型已删除请尽快修改）', '1.5', '4000', '0.2', '0'), ('7', '烫头', '1.3', '3000', '0.1', '1'), ('8', '洗头', '4', '2', '3', '1'), ('9', '高级造型师', '1.2', '2500', '0.2', '1');
COMMIT;

-- ----------------------------
--  Table structure for `expense`
-- ----------------------------
DROP TABLE IF EXISTS `expense`;
CREATE TABLE `expense` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) DEFAULT NULL COMMENT '支出项目名',
  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '支出时间',
  `money` double NOT NULL DEFAULT '0' COMMENT '支出金额',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `expense`
-- ----------------------------
BEGIN;
INSERT INTO `expense` VALUES ('1', '嫖娼', '老胡和老春去嫖娼', '2018-05-02 00:00:00', '1.1'), ('2', '房租', '房租', '2018-05-31 00:00:00', '500'), ('3', '水电', '水电费', '2018-05-10 00:00:00', '5000');
COMMIT;

-- ----------------------------
--  Table structure for `hibernate_sequence`
-- ----------------------------
DROP TABLE IF EXISTS `hibernate_sequence`;
CREATE TABLE `hibernate_sequence` (
  `next_val` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `hibernate_sequence`
-- ----------------------------
BEGIN;
INSERT INTO `hibernate_sequence` VALUES ('16'), ('16'), ('16'), ('16'), ('16'), ('16'), ('16'), ('16');
COMMIT;

-- ----------------------------
--  Table structure for `pay_list`
-- ----------------------------
DROP TABLE IF EXISTS `pay_list`;
CREATE TABLE `pay_list` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '充值时间',
  `goid` double NOT NULL DEFAULT '0' COMMENT '充值金额',
  `type` varchar(255) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FK6bhwpy0g63bo3l2hn9tfw5ke5` (`user_name`),
  CONSTRAINT `FK6bhwpy0g63bo3l2hn9tfw5ke5` FOREIGN KEY (`user_name`) REFERENCES `customer` (`user_name`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `pay_list`
-- ----------------------------
BEGIN;
INSERT INTO `pay_list` VALUES ('5', '2018-05-15 18:24:41', '300', '支付宝', '1'), ('6', '2018-05-17 23:59:06', '300', null, '1'), ('7', '2018-05-17 23:59:56', '3', null, '1'), ('8', '2018-05-18 08:17:35', '300', '支付宝转账', '1'), ('9', '2018-05-18 08:18:57', '300', '支付宝转账', '1'), ('10', '2018-05-18 23:48:26', '1111', '支付宝转账', '1'), ('11', '2018-05-18 23:56:17', '1000', '微信转账', '1'), ('12', '2018-05-27 16:11:21', '2', '支付宝转账', '1'), ('13', '2018-05-27 16:17:03', '1', '微信转账', '1'), ('14', '2018-05-27 16:17:31', '2', '支付宝转账', '1'), ('15', '2018-05-27 16:39:41', '2', '微信转账', '1'), ('18', '2018-05-19 22:52:31', '1', '微信转账', '1'), ('19', '2018-05-19 22:53:08', '1', '微信转账', '1'), ('21', '2018-05-19 22:55:28', '1', '支付宝转账', '1'), ('22', '2018-05-19 22:58:20', '1', '微信转账', '1'), ('23', '2018-05-20 17:40:25', '1000', '支付宝转账', '1'), ('24', '2018-05-20 17:40:43', '1', '微信转账', '1'), ('25', '2018-05-22 10:46:03', '1', '微信转账', '1'), ('26', '2018-05-27 16:57:39', '2', '微信转账', '1'), ('27', '2018-05-27 16:58:04', '3', '支付宝转账', '15736684366'), ('28', '2018-05-27 16:58:15', '3', '支付宝转账', '1'), ('29', '2018-05-27 16:58:28', '3', '现金充值', '1'), ('30', '2018-05-29 14:41:54', '21', 'QQ转账', '1'), ('31', '2018-05-31 15:57:24', '200', '支付宝转账', '1');
COMMIT;

-- ----------------------------
--  Table structure for `record`
-- ----------------------------
DROP TABLE IF EXISTS `record`;
CREATE TABLE `record` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `actually_paid` double NOT NULL DEFAULT '0' COMMENT '实付金额',
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '消费时间',
  `name` varchar(128) DEFAULT NULL COMMENT '消费的姓名',
  `payavle` double NOT NULL DEFAULT '0' COMMENT '应付金额',
  `service` int(11) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `number` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FKdud08qlcdbtpb3xpi8n9pn6tx` (`service`),
  KEY `FKla6jsx3599rrps9fe775hdes4` (`user_name`),
  KEY `FKd0q9r429dd1xf5psbw6srn2jj` (`number`),
  CONSTRAINT `FKd0q9r429dd1xf5psbw6srn2jj` FOREIGN KEY (`number`) REFERENCES `employee_manage` (`number`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FKdud08qlcdbtpb3xpi8n9pn6tx` FOREIGN KEY (`service`) REFERENCES `service_item` (`id`),
  CONSTRAINT `FKla6jsx3599rrps9fe775hdes4` FOREIGN KEY (`user_name`) REFERENCES `customer` (`user_name`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `record`
-- ----------------------------
BEGIN;
INSERT INTO `record` VALUES ('1', '49', '2018-05-27 09:54:36', null, '34.3', '1', '1', '0001'), ('2', '24', '2018-05-27 09:54:36', null, '12', '2', '1', '0002'), ('3', '49', '2018-05-27 15:44:46', null, '34.3', '1', '1', '0001'), ('4', '24', '2018-05-27 15:56:12', null, '12', '2', '1', '0002'), ('5', '49', '2018-05-29 14:37:43', null, '34.3', '1', '1', '0001'), ('6', '24', '2018-05-29 14:37:43', null, '12', '2', '1', '0002'), ('7', '49', '2018-05-29 14:37:53', null, '34.3', '1', '1', '0001'), ('8', '24', '2018-05-29 14:37:53', null, '12', '2', '1', '0002'), ('9', '49', '2018-05-29 14:37:57', null, '34.3', '1', '1', '0001'), ('10', '100', '2018-05-29 14:37:57', null, '50', '4', '1', '0002'), ('11', '49', '2018-05-29 14:38:01', null, '34.3', '1', '1', '0001'), ('12', '100', '2018-05-29 14:38:01', null, '50', '4', '1', '0002'), ('13', '49', '2018-05-30 20:05:49', null, '34.3', '1', '1', '0001'), ('14', '33.6', '2018-05-30 20:05:49', null, '23.52', '2', '1', '0001'), ('15', '140', '2018-05-30 20:05:49', null, '98', '4', '1', '0001'), ('16', '49', '2018-05-30 20:05:49', null, '34.3', '5', '1', '0001'), ('17', '49', '2018-05-30 20:43:53', null, '34.3', '1', '1', '0001'), ('18', '140', '2018-05-30 20:43:53', null, '98', '4', '1', '0001'), ('19', '49', '2018-05-30 20:59:31', null, '34.3', '1', '1', '0001'), ('20', '33.6', '2018-05-30 20:59:31', null, '23.52', '2', '1', '0001'), ('21', '140', '2018-05-30 20:59:31', null, '98', '4', '1', '0001'), ('22', '2.8', '2018-05-31 15:57:44', null, '1.96', '1', '1', '0001'), ('23', '33.6', '2018-05-31 15:57:44', null, '23.52', '2', '1', '0001'), ('24', '33.6', '2018-06-04 15:30:19', null, '23.52', '2', '1', '0001'), ('25', '100', '2018-06-04 15:30:19', null, '50', '4', '1', '0002'), ('26', '33.6', '2018-06-05 09:34:41', null, '23.52', '2', '1', '0001');
COMMIT;

-- ----------------------------
--  Table structure for `salary`
-- ----------------------------
DROP TABLE IF EXISTS `salary`;
CREATE TABLE `salary` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weighting_factor` double NOT NULL DEFAULT '0' COMMENT '加权系数',
  `basic_salary` double NOT NULL DEFAULT '0' COMMENT '基本工资',
  `commission_rate` double NOT NULL DEFAULT '0' COMMENT '提成比例',
  `count` int(11) DEFAULT NULL COMMENT '服务数',
  `name` varchar(128) DEFAULT NULL COMMENT '员工姓名',
  `number` varchar(128) DEFAULT NULL COMMENT '员工工号',
  `salary` double NOT NULL DEFAULT '0' COMMENT '应付工资',
  `date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `salary`
-- ----------------------------
BEGIN;
INSERT INTO `salary` VALUES ('1', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-06-07 19:46:17'), ('2', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-06-22 19:46:23'), ('3', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '0000-00-00 00:00:00'), ('4', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '0000-00-00 00:00:00'), ('5', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '0000-00-00 00:00:00'), ('6', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '0000-00-00 00:00:00'), ('7', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-06-23 19:46:28'), ('8', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-06-22 19:46:32'), ('9', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2017-12-31 00:00:00'), ('10', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2017-12-31 00:00:00'), ('11', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-04-01 00:00:00'), ('12', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-04-01 00:00:00'), ('13', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-04-01 00:00:00'), ('14', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-04-01 00:00:00'), ('15', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-05-01 00:00:00'), ('16', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-05-01 00:00:00'), ('17', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-04-01 00:00:00'), ('18', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-04-01 00:00:00'), ('19', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-04-01 00:00:00'), ('20', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-04-01 00:00:00'), ('21', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-04-01 00:00:00'), ('22', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-04-01 00:00:00'), ('23', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-04-01 00:00:00'), ('24', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-04-01 00:00:00'), ('25', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-04-01 00:00:00'), ('26', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-04-01 00:00:00'), ('27', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-04-01 00:00:00'), ('28', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-04-01 00:00:00'), ('29', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-04-01 00:00:00'), ('30', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-04-01 00:00:00'), ('31', '1.4', '3500', '0.3', '10', '谭永超', '0001', '322.54', '2018-04-01 00:00:00'), ('32', '1', '1500', '0.1', '8', '叶春林', '0002', '225.25', '2018-04-01 00:00:00');
COMMIT;

-- ----------------------------
--  Table structure for `service_item`
-- ----------------------------
DROP TABLE IF EXISTS `service_item`;
CREATE TABLE `service_item` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `introduction` varchar(128) DEFAULT NULL COMMENT '服务项目简介',
  `name` varchar(128) DEFAULT NULL COMMENT '服务项目名称',
  `price` double NOT NULL DEFAULT '0' COMMENT '服务项目价格',
  `type` varchar(11) DEFAULT NULL COMMENT '可提供该服务的员工类型',
  `status` tinyint(1) DEFAULT '1' COMMENT '判断服务是否在使用',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `service_item`
-- ----------------------------
BEGIN;
INSERT INTO `service_item` VALUES ('1', '剪头', '1', '2', '', '0'), ('2', '剪头', '剪头', '24', '5', '1'), ('4', '烫发1', '烫发', '100', '5,7,8', '0'), ('5', 'hu hu', '2', '35', '4,5', '1');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
